package com.ruoyi.partybuilding.common;

import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.StringUtils;
import lombok.var;

import java.util.List;

/**
 * 兼容ruoyi做的分页对象，不建议使用
 * @param <T>
 */
@Deprecated
public class TableDataInfoRows<T> extends TableDataInfo {

    List<T> rows;
    public List<T> getRows()
    {
        return rows;
    }

    public void setRows(List<?> rowList) {
        rows = (List<T>) rowList;
    }
    public static TableDataInfoRows toFail(String msg){
        var f=new TableDataInfoRows<>();
        f.setCode(500);
        f.setMsg(msg);
        return f;
    }
    public static TableDataInfoRows toEmpty(String msg){
        var f=new TableDataInfoRows<>();
        f.setCode(200);
        f.setMsg(msg);
        f.setTotal(0);
        return f;
    }
    public TableDataInfoRows(){}
    public TableDataInfoRows(Long total,List<?> list){
        setTotal(total);
        setRows(list);
        setCode(200);
    }
}
